package top.tomxwd.springcloud;

import com.netflix.hystrix.contrib.metrics.eventstream.HystrixMetricsStreamServlet;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.context.annotation.Bean;

/**
 * @author xieweidu
 * @createDate 2020-06-05 22:51
 */
@SpringBootApplication
@EnableEurekaClient
@EnableHystrix
public class DeptHystrixPv_8001 {

    public static void main(String[] args) {
        SpringApplication.run(DeptHystrixPv_8001.class, args);
    }

    @Bean
    public ServletRegistrationBean<HystrixMetricsStreamServlet> hystrixMetricsStreamServletServletRegistrationBean(){
        ServletRegistrationBean<HystrixMetricsStreamServlet> hmssr = new ServletRegistrationBean<>(new HystrixMetricsStreamServlet(),"/actuator/hystrix.stream");
        return hmssr;
    }

}
